package com.swehr.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Rock Huang
 * @version 0.1
 */
public class DashboardServlet extends HttpServlet {
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        ServletUtils.printRequestInfo(req);
        if (ServletUtils.toSignin(req, resp)) return;
        req.setAttribute("checked", "Dashboard");
        ServletUtils.forward(req, resp);
    }

    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        ServletUtils.printRequestInfo(req);
        ServletUtils.toSignin(req, resp);
    }

    protected void doPut(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        ServletUtils.printRequestInfo(req);
    }

    protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        ServletUtils.printRequestInfo(req);
    }

}
